<template>
    <div class="demo">
        <button @click="Sendname">新租件测试</button>
        <button @click="unbind">点我解绑事件</button>
        <button @click="death">销毁student的实例对象(vc)</button>
    </div>
</template>
<script>
    export default {
        name: 'StudentN',
        data() {
            return {
                name: '新方式传输',
                MyAge: 1
            }
        }, methods: {
            Sendname() {
                // this.$emit('demo', this.name)
                this.$emit('demo', this.name, 666, 8888.666)
                this.$emit('test')
            },
            unbind() {
                //解绑一个
                // this.$off('demo')
                console.log('解绑成功');
                //解绑多个
                this.$off(['demo', 'test'])
                //全部解绑
                // this.off()
            },
            death() {
                // this.$destroy()
            }
        }
    }
</script>
<style scoped lang="less">
    .demo {
        background-color: skyblue;

        .test {
            font-size: 20px
        }
    }
</style>